package cn.bookcycle.order.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.bookcycle.order.constant.DBConstant;
import cn.bookcycle.order.pojo.DBManipulateBO;
import net.sf.json.JSONObject;

/**
 * 调用数据库微服务工具类
 *
 * @author liufenglin
 * @date 2018年4月3日
 */
public class DaoUtil {
	private static final Logger logger = LoggerFactory.getLogger(DaoUtil.class);
	
	public static String dbManipulate(DBManipulateBO dbManipulateBO) {
		JSONObject jsonObject = JSONObject.fromObject(dbManipulateBO);
		logger.info("dbManipulate jsonObject:{}", jsonObject);
		String result = DBUtil.sendPost(DBConstant.DB_URI, DBConstant.DATA, jsonObject.toString(),"UTF-8");
		logger.info("dbManipulate返回的result:{}", result);
		return result;
	}
}
